<template>
  <div>
    <el-table
      :data="message"
      style="width: 1000px"
      border>
      <el-table-column
        prop="columnQustion"
        label="课程问题">
      </el-table-column>
      <el-table-column
        prop="columnAnswer"
        label="课程答疑">
      </el-table-column>

      <el-table-column
        label="操作"
        width="250px">
        <template slot-scope="scope">
          <el-button
            size="mini"
            @click="turnPage(scope.row.eid,'display')">查看
          </el-button>
          <el-button
            size="mini"
            @click="turnPage(scope.row.eid,'edit')">编辑
          </el-button>
          <el-button
            size="mini"
            type="danger"
            @click="turnPage(scope.row.eid,'del')">删除
          </el-button>
        </template>
      </el-table-column>

    </el-table>
  </div>
</template>

<script>
  import {SystemManageService} from '../SystemManageService'
    export default {
        name: "MessageList",
      data() {
        return {
          message: []
        }
      },
      mounted: function () {
        this.findAllCourseAnswers()
      },
      methods: {
        turnPage(eid, type) {
          this.$emit('turnPage', eid, type)
        },
        findAllCourseAnswers() {
          SystemManageService.findAllCourseAnswers().then(res => {
            this.message = res.data;
          })
        }
      }
    }
</script>

<style scoped>

</style>
